There may be provided data processing systems that support transactions in which a number of program instructions are executed speculatively in order to generate updates to state data that are then committed if the transaction completes without a conflict. Since the updates are only committed if the transaction completes without a conflict, such updates are also referred to herein as speculative updates until such time as they are committed. At any time until the transaction ends, the transaction can be aborted, that is complete without finishing, due to a conflict, thereby causing the data processing system to rewind or revert to a state prior to when the transaction began. This “rewinding” can hence occur in the event of a conflict between the instructions executed as part of the transaction and instructions that are executed elsewhere. During the transaction, the speculatively updated state is stored in transactional memory. If no conflict occurs, and the transaction is not aborted, then at the end of the transaction, the transaction is “committed” at which time the speculative state (i.e. the transactional state) replaces the actual state of the data processing system.
Such transactions may be used, for example, to facilitate multi-threaded processing using a shared memory in which transactions using data values within the shared memory may be allowed to proceed in parallel relying upon the ability to avoid committing speculative updates should a conflict arise between memory accesses. In most cases, such conflicts do not arise and accordingly the parallel processing proceeds efficiently without the need to support the overhead of more rigid mechanisms, such as the use of memory locks, and yet when a conflict does arise it is possible to recover as the speculative updates to state data will not have been committed.